From: Carlos Garnacho Date: Tue, 5 Mar 2019 18:33:49 +0000 (+0100) Subject: keyboard: align AspectContainer to bottom if restricting vertically X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~879^2^2~15 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=26b44b48ab6562ae9f3c0f6f1ea57731b20ddb71;p=gnome-shell.git keyboard: align AspectContainer to bottom if restricting vertically It is convenient for the OSK so it eg. doesn't appear centered in the available space (eg. on very narrow portrait layouts), plus it will also be convenient to align other AspectContainers to the same baseline. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/439 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index bfddcdec9..124831d6a 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -73,12 +73,9 @@ class AspectContainer extends St.Widget { box.x1 += Math.floor(diff / 2); box.x2 -= Math.ceil(diff / 2); } else { - /* Restrict vertically */ + /* Restrict vertically, align to bottom */ let height = box.get_width() / this._ratio; - let diff = box.get_height() - height; - - box.y1 += Math.floor(diff / 2); - box.y2 -= Math.floor(diff / 2); + box.y1 = box.y2 - Math.floor(height); } }